Carbon


RemoveCollectionItem

Header: Collections.h Carbon status: Supported

Removes an item from a collection given the item’s associated collection tag and collection ID.

OSErr RemoveCollectionItem (
    Collection c, 
    CollectionTag tag, 
    SInt32 id
);
c

A reference to the collection object from which you want to remove the item. The behavior of this function is undefined if you do not provide a reference to a valid collection object.

tag

The collection tag associated with the item you want to remove.

id

The collection ID associated with the item you want to remove.

function result

A result code. If the c collection does not contain an item whose collection tag and collection ID match the values in the tag and id parameters, this function returns a collectionItemNotFoundErr result code.

DISCUSSION

The RemoveCollectionItem function removes the item specified by the tag and id parameters from the collection referenced by the c parameter. This function removes the specified item even if its lock attribute is set.

To remove a collection item using the item’s index (rather than the item’s tag and ID), use the RemoveIndexedCollectionItem function.

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)